/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ftpcombiner.gui.applicationframe;

import ftpcombiner.ApplicationController;
import ftpcombiner.gui.GUILoader;
import ftpcombiner.gui.GUIResources;
import ftpcombiner.listeners.DeleteListener;
import ftpcombiner.listeners.DownloadListener;
import ftpcombiner.listeners.UploadListener;
import javax.swing.JButton;
import javax.swing.JToolBar;

/**
 *
 * @author Ben
 */
public class ToolBar extends JToolBar implements GUILoader {

    private JButton downloadButton, uploadButton, deleteButton;

    public ToolBar() {
        init();
    }

    private void init() {
        initializeComponents();
        otherInit();
        setLayouts();
        addComponents();
        addComponentListeners();
    }

    @Override
    public void initializeComponents() {
        downloadButton = new JButton(GUIResources.getInstance().getDownloadIcon());
        uploadButton = new JButton(GUIResources.getInstance().getUploadIcon());
        deleteButton = new JButton(GUIResources.getInstance().getDeleteIcon());
    }

    @Override
    public void setLayouts() {
    }

    @Override
    public void addComponents() {
        add(downloadButton);
        add(uploadButton);
        add(deleteButton);
    }

    @Override
    public void addComponentListeners() {
        uploadButton.addMouseListener(new UploadListener());
        downloadButton.addMouseListener(new DownloadListener());
        deleteButton.addMouseListener(new DeleteListener());
    }

    @Override
    public void otherInit() {
        downloadButton.setToolTipText("Download Selected");
        uploadButton.setToolTipText("Upload...");
        deleteButton.setToolTipText("Delete Selected");
        ApplicationController.getSplashScreen().incrementProgress();
    }
}
